import { Entity, Column, PrimaryGeneratedColumn, BaseEntity } from 'typeorm';

@Entity("affiliate", { synchronize: true })
export class Affiliate extends BaseEntity {

    @PrimaryGeneratedColumn({ type: 'bigint', comment: '会员ID' })
    affiliate_id!: number;

    @Column({ type: 'char', length: 1, comment: '会员状态（0未开启 1正常）', default: '0' })
    affiliate_state: string = '0';

    @Column({ type: 'timestamp', comment: '会员过期时间', default: '0000-00-00' })
    affiliate_end_time: Date = new Date;

    @Column({ type: 'timestamp', comment: '修改时间' })
    affiliate_update_time: Date = new Date;

    @Column({ type: 'int', comment: '会员开通次数', default: 0 })
    affiliate_debuts_number: number = 0;

    @Column({ type: 'decimal', comment: '享钻', default: 0.0000 })
    integral: number = 0.0000;

    @Column({ type: 'decimal', comment: '享积分', default: 0.0000 })
    score: number = 0.0000;

    @Column({ type: 'varchar', nullable: true, comment: '备注', default: '' })
    remark?: string;

}